package com.LONE.spring6.tx.controller;

import com.LONE.spring6.tx.service.BookService;
import com.LONE.spring6.tx.service.CheckoutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @Project ：learn_spring
 * @File ：BookController.java
 * @IDE ：IntelliJ IDEA
 * @Author ：自由如风间
 * @Date ：2025/4/5 10:55
 * @Description ：For study.
 */

@Controller
public class BookController {

    /*
    @Autowired
    private BookService bookService;
    */

    /*
    public boolean buyBook(Integer bookId, Integer userId) {
        return bookService.buyBook(bookId, userId);
    }
    */

    @Autowired
    private CheckoutService checkoutService;

    public void checkout(Integer[] bookIds, Integer userId) {
        checkoutService.checkout(bookIds, userId);
    }
}
